<%@ page language="java" contentType="text/html;charset=utf-8" pageEncoding="utf-8"%>

<%@ include file="/core/taglibs.jsp"%>
<!DOCTYPE html>
<html lang="zh-CN">

<head>


    <%@ include file="/core/memberMeta.jsp"%>
    <script src="<%=basePath%>/resources/memberCss/assets/js/jquery-1.10.2.min.js"></script>
    <script type="text/javascript">




    </script>
    <script type="text/javascript">

        function recommendChange(){
            var recommendLoginName=$("#recommendLoginName").val();

            $.getJSON("<%=basePath%>/ajaxGetRecommendByName3.shtml",{recommendLoginName: recommendLoginName},function(result){
                //填入新值
                if(result.success==true){

                    $("#recommendPersonName").html("推荐人存在，姓名:"+result.member.personName);
                }else{

                    $("#recommendPersonName").html("<b  style='color: red;'>推荐人不存在</b>");
                }

            });
        }

        function centerChange(){

            var centerLoginName=$("#centerLoginName").val();

            $.getJSON("<%=basePath%>/ajaxGetCenterByName.shtml",{centerLoginName: centerLoginName},function(result){
                //填入新值
                if(result.success==true){

                    $("#centerPersonName").html("服务中心姓名:"+result.member.personName);
                }else{

                    $("#centerPersonName").html("<b  style='color: red;'>该代理商不是服务中心</b>");
                }

            });
        }

        function fatherChange(){

            var fatherLoginName=$("#fatherLoginName").val();

            $.getJSON("<%=basePath%>/ajaxGetFatherByName.shtml", {fatherLoginName : fatherLoginName}, function(result) {
                //填入新值
                if (result.success == true) {
                    $("#fatherPersonName").html(result.title);
                } else {

                    $("#fatherPersonName").html(
                        "<b  style='color: red;'>节点人不存在</b>");
                }

            });
        }

        function loginNameChange(){
            var loginName=$("#loginName").val();

            $.getJSON("<%=basePath%>/ajaxGetMemberByName.shtml", {loginName : loginName}, function(result) {
                //填入新值
                if (result.success == true) {

                    $("#loginNamePersonName").html("<b '>账号名可以用</b>");
                } else {
                    $("#loginNamePersonName").html(
                        "<b  style='color: red;'>账号名已经存在</b>");
                }

            });


        };


    </script>
</head>

<body>
<script src="<%=basePath%>/resources/memberCss2/assets/js/theme.js"></script>
<section class="wrapper">
    <div class="row">
        <div class="col-lg-12">
            <section class="panel">
                <header class="panel-heading"> 注册代理商 </header>
                <div class="panel-body">
                    <form id="commitForm" class="form-horizontal adminex-form" action="<%=basePath%>/memberRegister.shtml?type=10" method="post" onsubmit="return check()">
                        <jodd:form scopes="request" beans="member">
                            <div class="form-group">
                                <label class="col-sm-2 col-sm-2 control-label">代理商编号：</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control m-bot15" id="loginName" name="loginName" onchange="loginNameChange()" /> <span id="loginNamePersonName"></span>

                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 col-sm-2 control-label">代理商级别</label>
                                <div class="col-sm-10">
                                    <select type="select" class="form-control m-bot15" id="dailiId" name="dailiId">
                                        <c:forEach items="${dailiList}" var="o">
                                            <option value="${o.id}">${o.title}(${o.payNum})</option>
                                        </c:forEach>
                                    </select>
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 col-sm-2 control-label">推荐人编号：</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control m-bot15" id="recommendLoginName" name="recommendLoginName" onchange="recommendChange()" /> <span id="recommendPersonName"></span>
                                    <span style="color: red">(*必填)</span>
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 col-sm-2 control-label">接点人编号：</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control m-bot15" id="fatherLoginName" name="fatherLoginName" onchange="fatherChange()" /> <span id="fatherPersonName"></span>

                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 col-sm-2 control-label">所在区域：</label>
                                <div class="col-sm-10">
                                    <c:if test="${qu!=null&&qu!=''}">
                                        <c:if test="${qu=='1'}">
                                            <input type="radio" name="qu" value="1" checked="checked" />
                                            <label for="">节点人的左区</label>

                                            <input type="radio" name="qu" value="2" />
                                            <label for="">节点人的右区</label>

                                        </c:if>
                                        <c:if test="${qu=='2'}">
                                            <input type="radio" name="qu" value="1" />
                                            <label for="">节点人的左区</label>

                                            <input type="radio" name="qu" value="2" checked="checked" />
                                            <label for="">节点人的右区</label>

                                        </c:if>
                                    </c:if>
                                    <c:if test="${qu==null||qu==''}">

                                        <input type="radio" name="qu" value="1" checked="checked" />
                                        <label for="">节点人的左区</label>

                                        <input type="radio" name="qu" value="2" />
                                        <label for="">节点人的右区</label>

                                    </c:if>
                                </div>
                            </div>


                            <div class="form-group">
                                <label class="col-sm-2 col-sm-2 control-label">服务中心编号：</label>
                                <div class="col-sm-10">
                                    <input type="text" id="centerLoginName" name="centerLoginName" onchange="centerChange()" class="form-control m-bot15"/><span id="centerPersonName"/>
                                    <span style="color: red">(*必填)</span>
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 col-sm-2 control-label">登陆密码：</label>
                                <div class="col-sm-10">
                                    <input type="password" class="form-control m-bot15" id="onePassword" name="onePassword" /> <span style="color: red">(*必填)</span>
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 col-sm-2 control-label">确认登陆密码：</label>
                                <div class="col-sm-10">
                                    <input type="password" class="form-control m-bot15" id="onePasswordRec" name="onePasswordRec" /> <span style="color: red">(*必填)</span>
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 col-sm-2 control-label">安全密码：</label>
                                <div class="col-sm-10">
                                    <input type="password" class="form-control m-bot15" id="twoPassword" name="twoPassword" /> <span style="color: red">(*必填)</span>
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 col-sm-2 control-label">确认安全密码：</label>
                                <div class="col-sm-10">
                                    <input type="password" class="form-control m-bot15" id="twoPasswordRec" name="twoPasswordRec" /> <span style="color: red">(*必填)</span>
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 col-sm-2 control-label">手机号码：</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control m-bot15" id="tel" name="tel" />
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 col-sm-2 control-label">姓名：</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control m-bot15" id="personName" name="personName" />
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 col-sm-2 control-label">地址：</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control m-bot15" id="dizhi" name="dizhi" />
                                </div>
                            </div>

                            <div class="form-group">
                                <div style="color: red; text-align: center;" class="text-center">${retMsg}</div>
                            </div>


                            <div class="form-group text-center" style="text-align: center;">
                                <input type="submit" class="btn btn-primary" value=" 提 交 " style="width: 90px;font-weight: bold;font-size: 17px;" /> <input type="reset" class="btn btn-success" value=" 重 置 " style="width: 90px;font-weight: bold;font-size: 17px;" />
                            </div>

                        </jodd:form>
                    </form>
                </div>
            </section>
        </div>
    </div>
</section>
<script src="<%=basePath%>/resources/memberCss2/assets/js/amazeui2.min.js"></script>
<script src="<%=basePath%>/resources/memberCss2/assets/js/amazeui.datatables.min.js"></script>
<script src="<%=basePath%>/resources/memberCss2/assets/js/dataTables.responsive.min.js"></script>
<script src="<%=basePath%>/resources/memberCss2/assets/js/app.js"></script>

<!--代码高亮end-->
<c:if test="${result}">
    <script language="JavaScript" type="text/javascript">
        alert('${retMsg}');
        top.location='<%=basePath%>/login.jsp';
    </script>
</c:if>

</body>

</html>